﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using HoangHuy.data;
using System.Linq;

namespace ERP.form
{
    public partial class frmDanhSachLoaiHang : DevExpress.XtraEditors.XtraForm
    {
        public frmDanhSachLoaiHang()
        {
            InitializeComponent();
        }
        public MobileDataDataContext context = new MobileDataDataContext();

        public void loadData()
        { 
            var data = (from o in context.LoaiHangs
                            select new
                            {
                                id = o.id,
                                tenLoaiHang = o.tenLoaiHang,
                                MặtHàng = o.matHangs
                            });
            grdLoaiHang.DataSource = data;
        }

        private void frmDanhSachLoaiHang_Load(object sender, EventArgs e)
        {
            loadData();
        }
    }
}